#include "gamekit/scripting/Arguments.h"

extern "C"
{
	#include "gamekit-lua/lua.h"
	#include "gamekit-lua/lualib.h"
	#include "gamekit-lua/lauxlib.h"
}

using namespace gamekit::scripting;

Arguments::Arguments(lua_State* state)
	: m_state(state)
{
}

Arguments::~Arguments()
{
}

uint Arguments::count(void) const
{
	int argc = lua_gettop(m_state);
	return argc;
}

Object Arguments::operator [] (uint index) const
{
	if(index > count())
	{
		return Object::Null();
	}

	return Object(m_state, index + 1);
}
